package com.ruoyi.biz.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.biz.mapper.BizSingleLineAnnotationMapper;
import com.ruoyi.biz.domain.BizSingleLineAnnotation;
import com.ruoyi.biz.service.IBizSingleLineAnnotationService;

/**
 * 单条直线标注Service业务层处理
 * 
 * @author cc
 * @date 2025-11-11
 */
@Service
public class BizSingleLineAnnotationServiceImpl implements IBizSingleLineAnnotationService 
{
    @Autowired
    private BizSingleLineAnnotationMapper bizSingleLineAnnotationMapper;

    /**
     * 查询单条直线标注
     * 
     * @param id 单条直线标注主键
     * @return 单条直线标注
     */
    @Override
    public BizSingleLineAnnotation selectBizSingleLineAnnotationById(Long id)
    {
        return bizSingleLineAnnotationMapper.selectBizSingleLineAnnotationById(id);
    }

    /**
     * 查询单条直线标注列表
     * 
     * @param bizSingleLineAnnotation 单条直线标注
     * @return 单条直线标注
     */
    @Override
    public List<BizSingleLineAnnotation> selectBizSingleLineAnnotationList(BizSingleLineAnnotation bizSingleLineAnnotation)
    {
        return bizSingleLineAnnotationMapper.selectBizSingleLineAnnotationList(bizSingleLineAnnotation);
    }

    /**
     * 新增单条直线标注
     * 
     * @param bizSingleLineAnnotation 单条直线标注
     * @return 结果
     */
    @Override
    public int insertBizSingleLineAnnotation(BizSingleLineAnnotation bizSingleLineAnnotation)
    {
        bizSingleLineAnnotation.setCreateTime(DateUtils.getNowDate());
        return bizSingleLineAnnotationMapper.insertBizSingleLineAnnotation(bizSingleLineAnnotation);
    }

    /**
     * 修改单条直线标注
     * 
     * @param bizSingleLineAnnotation 单条直线标注
     * @return 结果
     */
    @Override
    public int updateBizSingleLineAnnotation(BizSingleLineAnnotation bizSingleLineAnnotation)
    {
        bizSingleLineAnnotation.setUpdateTime(DateUtils.getNowDate());
        return bizSingleLineAnnotationMapper.updateBizSingleLineAnnotation(bizSingleLineAnnotation);
    }

    /**
     * 批量删除单条直线标注
     * 
     * @param ids 需要删除的单条直线标注主键
     * @return 结果
     */
    @Override
    public int deleteBizSingleLineAnnotationByIds(Long[] ids)
    {
        return bizSingleLineAnnotationMapper.deleteBizSingleLineAnnotationByIds(ids);
    }

    /**
     * 删除单条直线标注信息
     * 
     * @param id 单条直线标注主键
     * @return 结果
     */
    @Override
    public int deleteBizSingleLineAnnotationById(Long id)
    {
        return bizSingleLineAnnotationMapper.deleteBizSingleLineAnnotationById(id);
    }

    @Override
    public List<BizSingleLineAnnotation> getLinesByDrawingId(Long drawingId) {
        BizSingleLineAnnotation queryParam = new BizSingleLineAnnotation();
        queryParam.setDrawingId(drawingId);
        return  bizSingleLineAnnotationMapper.selectBizSingleLineAnnotationList(queryParam);
    }

    @Override
    public int batchInsertBizSingleLineAnnotation(List<BizSingleLineAnnotation> annotations) {
        return bizSingleLineAnnotationMapper.batchInsertBizSingleLineAnnotation(annotations);
    }
}
